#ifndef _XUTILS_H_
#define _XUTILS_H_

#ifdef WIN32
#include "winsock2.h"
#include <conio.h>
void msleep( int x )
{
  Sleep( x );
};
int mygetch()
{
  return _getch();
}
#else
#include <unistd.h>
#include <stdio.h>
#include <termios.h>
void msleep( int x )
{
  usleep( 1000*x );
};
int mygetch()
{
  struct termios oldt,newt;
  int ch;
  tcgetattr( STDIN_FILENO, &oldt );
  newt = oldt;
  newt.c_lflag &= ~( ICANON | ECHO );
  tcsetattr( STDIN_FILENO, TCSANOW, &newt );
  ch = getchar();
  tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
  return ch;
}
#endif

#define PI 3.14159265358979f

#endif

